package com.erpoa.multiple;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @description:
 * @author: jamin.chen
 * @createDate: 2020/1/13 15:28
 * @version: 1.0
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    /**
     * 动态数据源（需要继承AbstractRoutingDataSource）
     */
    @Override
    protected Object determineCurrentLookupKey() {
        return DatabaseContextHolder.getDatabaseType();
    }

}
